home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-05-01 | 979 b | 41 lines | [TEXT/MPS ] |
- #open "obj";;
-
- type lexbuf =
- { refill_buff : string -> int -> int;
- lex_buffer : string;
- mutable lex_abs_pos : int;
- mutable lex_start_pos : int;
- mutable lex_curr_pos : int;
- mutable lex_last_pos : int;
- mutable lex_last_action : lexbuf -> obj }
- ;;
-
- value dummy_action : lexbuf -> obj
- and create_lexer : (string -> int -> int) -> lexbuf
- and create_lexer_channel : in_channel -> lexbuf
- and lex_refill : lexbuf -> unit
- and get_next_char : lexbuf -> char
- and get_lexeme : lexbuf -> string
- and get_lexeme_char : lexbuf -> int -> char
- and backtrack : lexbuf -> 'a
- and get_lexeme_start : lexbuf -> int
- and get_lexeme_end : lexbuf -> int
- ;;
-
- type lexer_state =
- Lbacktrack
- | Lperform of int
- | Lshift of int * int
- | Lremshift of int * int * int
- ;;
-
- type lexer_tables =
- { llstates: lexer_state vect;
- llact: (lexbuf -> obj) vect;
- lltable: string;
- llcheck: string }
- ;;
-
- value run_lexer : lexer_tables -> int -> lexbuf -> 'a
- ;;
-